/*******************************************************************************************
*
* Copyright (C) 2022 Guangzhou AoYiDuo Network Technology Co.,Ltd. All Rights Reserved.
*
* Contact: http://www.aoyiduo.com
*
*   this file is used under the terms of the GPLv3[GNU GENERAL PUBLIC LICENSE v3]
* more information follow the website: https://www.gnu.org/licenses/gpl-3.0.en.html
*
*******************************************************************************************/

#include "qwosortfilterproxymodel.h"

QWoSortFilterProxyModel::QWoSortFilterProxyModel(int maxColumn, QObject *parent)
    : QSortFilterProxyModel(parent)
    , m_maxColumnCount(maxColumn)
{

}

int QWoSortFilterProxyModel::columnCount(const QModelIndex &parent) const
{
    int cnt = QSortFilterProxyModel::columnCount(parent);
    if(cnt > m_maxColumnCount) {
        return m_maxColumnCount;
    }
    return cnt;
}
